<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
<script>
    if(navigator.serviceWorker) {
        navigator.serviceWorker.register('sw.js').then(() => {
            console.log('注册成功')
        }).catch((err) => {
            console.log('注册失败', err)
        })
    }
</script>
</html>